package code.example.zookeeper.base.command.read;

import code.example.zookeeper.ZookeeperHolder;
import org.apache.zookeeper.Watcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class GetChildren {
    private Logger logger = LoggerFactory.getLogger(GetChildren.class);
    ZookeeperHolder holder = null;
    public GetChildren(ZookeeperHolder holder){
        this.holder  = holder;
    }
    public void getChildrenForWatcher(String path,Watcher watcher) throws Exception {

        logger.info("[getChildren]:register watcher for path:"+path);
        this.holder.getInstance().getChildren(path,watcher);
    }
}
